package com.ruoyi.hotel.wx.mp.config.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MobileUtil {
    public static String getMobileNum(String content){
        Pattern pattern = Pattern.compile("(?<!\\d)(?:(?:1[3456789]\\d{9})|(?:861[3456789]\\d{9}))(?!\\d)");
        Matcher matcher = pattern.matcher(content);
        StringBuffer bf = new StringBuffer(128);
        while (matcher.find()) {
            return matcher.group();
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(MobileUtil.getMobileNum("你好 13424251240"));
    }
}
